package com.hx.collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

/**
 * @author jxlgcmh
 * @create 2019-05-06 15:08
 */
public class CollectionDemo1 {
    public static void main(String[] args) {
        Collection collection = new ArrayList<>();
        collection.add(88888);
        collection.add(885588);
        collection.add(8877888);
        collection.add(8778888);
        collection.add(8888877);
        Iterator iterator = collection.iterator();
        while (iterator.hasNext()) {
            int res = (int) iterator.next();
            if (88888 == res) {
                iterator.remove();
            }
        }
        System.out.println(collection.size());
        for (Object o : collection) {
            System.out.println(o);
        }
    }
}
